package com.xunyin.modules.version2.log.rest;


import com.xunyin.api.ApiResult;
import com.xunyin.modules.log.AppLog;
import com.xunyin.modules.log.domain.TCleaningRecord;
import com.xunyin.modules.log.service.TCleaningRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 共享空间:小程序端保洁日志管理控制器
 * </p>
 * Created by xunyin
 * CopyRight 讯音云商 https://www.tonetn.com
 *
 * @since 2023-4-24
 */
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(value = "共享空间:小程序端保洁日志管理控制器", tags = "共享空间:小程序端保洁日志管理控制器")
public class ClientTCleaningRecordController {

    /**
     * 保洁日志接口
     */
    private final TCleaningRecordService tCleaningRecordService;

    /**
     * 获取小程序端保洁日志管理
     */
    @AppLog(value = "获取小程序端保洁日志管理列表", type = 1)
    //@AuthCheck
    @PostMapping("/cleaning/list")
    @ApiOperation(value = "获取小程序端保洁日志管理列表", notes = "获取小程序端保洁日志管理列表")
    public ApiResult<List<TCleaningRecord>> getCleaningRecordList(HttpServletRequest request, @RequestBody TCleaningRecord tCleaningRecord) {
        List<TCleaningRecord> dataList = tCleaningRecordService.queryCleaningRecordList(tCleaningRecord);
        log.info("getTCleaningRecordList -> dataList={}", dataList.toString());
        return ApiResult.ok(dataList);
    }



}
